<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('level')} > ${i18n.getMessage('edit')}">
</@showTitle>

<div id="error" style="display:none"></div>

<form action="program/editLevel.sgt" validator="program/validateLevel.sgt" onsubmit="submitFormValidation(this); return false;" onreset="$('error').hide()">
	<input type="hidden" name="id" value="${(level.id)!}"/>

	<table id="dataTable" align="center" cellspacing="5" cellpadding="0">
		<tr>
			<td class="name"><@required/>${i18n.getMessage('name')}:</td>
			<td><input type="text" name="name" value="${(level.name)!}" style="width:200px"/> </td>
		</tr>
		<tr>
			<td class="name"><@required/>${i18n.getMessage('time')}:</td>
			<td>
				<input type="text" name="hours" value="${(level.hours)!}" style="width:60px"/> hours
				<input type="text" name="weeks" value="${(level.weeks)!}" style="width:60px"/> weeks
			</td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('score')}:</td>
			<td>
				<input type="text" name="minScore" value="${(level.minScore)!}" style="width:60px"/> Min
				<input type="text" name="maxScore" value="${(level.maxScore)!}" style="width:60px"/> Max
			</td>
		</tr>
		<tr>
			<td class="name"><@required/>Tuition:</td>
			<td><input type="text" name="tuition" value="${(level.tuition.amount)!}" style="text-align:right;width:170px"/> ${i18n.getMessage('currency.usd')}</td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('options')}:</td>
			<td><input type="checkbox" name="active" value="true" <#if level.active>checked</#if>/> ${i18n.getMessage('active')}</td>
		</tr>
		<tr>
			<td class="name" style="vertical-align:top">${i18n.getMessage('content')}:</td>
			<td><textarea name="content" style="width:350px;height:80px;">${(level.content)!}</textarea></td>
		</tr>
		<tr>
			<td class="name"></td>
			<td>
				<input type="submit" value="${i18n.getMessage('edit')}" class="button_style"/> 
				<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
			</td>
		</tr>
	</table>
</form>

<script>
	$('error').hide();
</script>